/********************************************************************
	TABAL ENGINE - 2012/11/01
	author:		Marc Cuscullola
	
	purpose:	Controls the time of the game
*********************************************************************/
#pragma once

#ifndef __CLOCK__INCLUDED_H__
#define __CLOCK__INCLUDED_H__

#include "MathTypes.h"

class CClock
{
public:
	CClock(uint32 _uAvSamples);
	~CClock();

	void	Update			(float _fAddRestValue = 0.f);
	
	float	GetElapsedTime	() const;
	float	GetFPS			() const;
	float	GetTotalTime	() const;

private:
	float		m_fElpasedTime;		// ElapsedTime
	float		m_fFPS;				// FPS
	float		m_fTotalTime;
	float		m_fLastFps;
	float		m_fFPSTime;
	double		m_dLastTime;
	uint32		m_uFPSCount;
	float*		m_Deltas;			// array of instant delta times
	uint32		m_uSamples;			// deltas arrays length
	uint32		m_uIndex;			// current array position
};

#endif //__CLOCK__INCLUDED_H__